﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DLL;
using Module;

namespace BLL
{
    public class BRelationPaper
    {

        #region 字段

        private DRelationPaper APP = new DRelationPaper();//数据操作对象
        private static BRelationPaper instance;

        #endregion

        #region 公共接口
        /// <summary>
        /// 取得
        /// </summary>
        /// <returns>BRelationPaper对象</returns>
        public static BRelationPaper getInstance()
        {
            if (instance == null)
            {
                instance = new BRelationPaper();
            }
            return instance;
        }
         /// <summary>
        /// 添加
        /// </summary>
        /// <param name="relationPaperInfo"></param>
        /// <returns></returns>
        public bool Insert(RelationPaperInfo relationPaperInfo)
        {
            if (relationPaperInfo == null || relationPaperInfo.RelationPaperId == 0)
                return false;
            return APP.Insert(relationPaperInfo);
        }
         /// <summary>
        /// 更新
        /// </summary>
        /// <param name="relationPaperInfo"></param>
        /// <returns></returns>
        public bool Update(RelationPaperInfo relationPaperInfo)
        {
             if (relationPaperInfo == null || relationPaperInfo.RelationPaperId == 0)
                return false;
             return APP.Update(relationPaperInfo);
        }
        /// <summary>
        /// 根据会员关系ID删除相关会员动态文章关系表
        /// </summary>
        /// <param name="userRelationId"></param>
        /// <returns></returns>
        public int Delete(long userRelationId)
        {
            if (userRelationId == 0)
                return 0;
            return APP.Delete(userRelationId);
        }
        /// <summary>
        /// 根据文章Id删除会员动态关系文章
        /// </summary>
        /// <param name="paperId"></param>
        /// <returns></returns>
        public int DeleteByPaPerId(long paperId)
        {
            if (paperId == 0)
                return 0;
            return APP.DeleteByPaPerId(paperId);
        }

        #endregion
    }
}
